#include <malloc.h>
#include "11_lib.h"
BiTree create(void)
{
	BiTree tree = NULL;
	char c;
	if((c = fgetc(stdin)) != '#' && c != '\n')
	{
		tree = (BiTree)malloc(sizeof(BiTNode));
		tree->data = c;
		tree->l = create();
		tree->r = create();
	}
	return tree;
}
// 前序
void PerOrder(BiTree tree)
{
	printf("%c",tree->data);
	if(tree->l != NULL)
	{
		PerOrder(tree->l);
	}
	if(tree->r != NULL)
	{
		PerOrder(tree->r);
	}
}
// 中序
void InOrder(BiTree tree)
{
	if(tree->l != NULL)
	{
		InOrder(tree->l);
	}
	printf("%c",tree->data);
	if(tree->r != NULL)
	{
		InOrder(tree->r);
	}
}
// 后序
void PostOrder(BiTree tree)
{
	if(tree->l != NULL)
	{
		PostOrder(tree->l);
	}
	if(tree->r != NULL)
	{
		PostOrder(tree->r);
	}
	printf("%c",tree->data);
}
